﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
 * 版权所有 (c) 2022   保留所有权利。
 * CLR版本：4.0.30319.42000
 * 机器名称：DESKTOP-UL84BU5
 * 公司名称：
 * 命名空间：KingerRobot.WanliWMS.Spi
 * 唯一标识：52fba7fb-c413-49de-81a7-726f66128b74
 * 文件名：ISettingService
 * 当前用户域：DESKTOP-UL84BU5
 * 
 * 创建者：zzl
 * 电子邮箱：1003590782@qq.com
 * 创建时间：2022/7/4 15:37:56
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
using KingerRobot.MexicoSailunMES.Dao;

namespace KingerRobot.MexicoSailunWMS.Spi;

public interface ITaskService
{
    /// <summary>
    /// 查询任务信息
    /// </summary>
    /// <param name="taskBean">任务类型；单号；</param>
    /// <returns></returns>
    List<TaskBean> GetTaskList(TaskParm taskBean);
    /// <summary>
    /// 修改任务为完成
    /// </summary>
    /// <param name="parm">任务号</param>
    /// <returns></returns>

    int FinishTask(TaskOperParm parm, long userId, string userName, string clientHost);
    /// <summary>
    /// 删除任务
    /// </summary>
    /// <param name="parm">任务号</param>
    /// <returns></returns>
    int DeleteTask(TaskOperParm parm, long userId, string userName, string clientHost);
    /// <summary>
    /// 查询任务指令信息
    /// </summary>
    /// <param name="parm">任务类型；单号；</param>
    /// <returns></returns>
    List<TaskCmdBean> GetTaskCmdList(TaskParm parm);
    /// <summary>
    /// 删除指令
    /// </summary>
    /// <param name="parm">单号</param>
    /// <returns></returns>
    int DeleteTaskCmd(TaskOperParm parm);
    /// <summary>
    /// 完成指令
    /// </summary>
    /// <param name="parm">任务号</param>
    /// <returns></returns>
    int FinishTaskCmd(TaskOperParm parm);
    /// <summary>
    /// 再次下发指令
    /// </summary>
    /// <param name="parm"></param>
    /// <returns></returns>
    int SendAgainTaskCmd(TaskOperParm parm);

    /// <summary>
    /// 获取任务状态
    /// </summary>
    /// <returns></returns>
    List<TaskStatus> GetTaskStatus();
    /// <summary>
    /// 通过条码获取异常信息
    /// </summary>
    /// <param name="ProductCode"></param>
    /// <returns></returns>
    TaskException GetTaskException(string ProductCode);
    /// <summary>
    /// PDA扫码入库
    /// </summary>
    /// <param name="pdaInParam"></param>
    /// <returns></returns>
    string AddPDATask(PdaInParam pdaInParam);
    /// <summary>
    /// 异常口绑定
    /// </summary>
    /// <param name="pdaAbnormalInParam"></param>
    /// <returns></returns>
    string AddAbnormalPdaTask(PdaAbnormalInParam pdaAbnormalInParam);
    /// <summary>
    /// OutOrderDelivery
    /// </summary>
    /// <returns></returns>
    //string OutOrderDelivery();

    bool DeleteOutOrder(long master_id);


    string Query(string locName, string taskNo, string spec, string OrderByType, string OrderByName, string productCode);
    /// <summary>
    /// pda任务删除
    /// </summary>
    /// <param name="productCode"></param>
    /// <returns></returns>
    int DelTask(string productCode);
    /// <summary>
    /// 获取硫化请料中间表
    /// </summary>
    /// <param name="no"></param>
    /// <returns></returns>
    //List<POCruingAsrsMonitor> QueryCruingAsrsMonitor(CuringMonitorParm parm);

    List<AbnormalBean> GetAbnormalList(AbnormalParm parm);
}
public class CuringMonitorParm
{
    public string no { get; set; }
    /// <summary>
    /// 是否请料	0:否 1:是
    /// </summary>
    public string isEnableRequest { get; set; }
    /// <summary>
    /// 是否可放货 0:否 1:是
    /// </summary>
    public string isEnablePush { get; set; }
    /// <summary>
    /// 机台状态 1:正常
    /// </summary>
    public string equipStatusMes { get; set; }
    /// <summary>
    /// 机台状态（上位机）0：异常 1：正常
    /// </summary>
    public string equipStatusHost { get; set; }
    /// <summary>
    /// 修改标志 1:上位机修改 2:WMS已读取
    /// </summary>
    public string hostWmsFlag { get; set; }
    /// <summary>
    /// 修改标志 1:MES修改 2:WMS已读取
    /// </summary>
    public string mesWmsFlag { get; set; }
}

public class PdaInParam
{
    /// <summary>
    /// 选择堆垛机
    /// </summary>
    public long CrnId { get; set; }
    /// <summary>
    /// 入库口1条码
    /// </summary>
    public string ProductCode1 { get; set; }
    /// <summary>
    /// 入库口2条码
    /// </summary>
    public string ProductCode2 { get; set; }
}

public class PdaAbnormalInParam
{
    /// <summary>
    /// 入库口2条码
    /// </summary>
    public string ProductCode { get; set; }
}
public class TaskParm
{
    /// <summary>
    /// 任务类型
    /// </summary>
    public string TaskType { get; set; }
    /// <summary>
    /// 任务号
    /// </summary>
    public string TaskNo { get; set; }
    /// <summary>
    /// 条码
    /// </summary>
    public string BarCode { get; set; }
    /// <summary>
    /// 当前设备Id
    /// </summary>
    public string EquipId { get; set; }

    public DateTime? StartTime { get; set; }
    public DateTime? EndTime { get; set; }

    public string TargetLoc { get; set; }
    /// <summary>
    /// 当前设备名
    /// </summary>
    public string EquipName { get; set; }

    public string OrderByName { get; set; }

    public string OrderByType { get; set; }

}
public class TaskType
{
    public int TypeKey { get; set; }
    public string TypeDesc { get; set; }
}
public class TaskException
{
    /// <summary>
    /// 是否找到：0 未找到；1 找到
    /// </summary>
    public int TaskFalg { get; set; }
    /// <summary>
    /// 异常信息
    /// </summary>
    public string Message { get; set; }
}

public class AddPDATaskBean
{
    /// <summary>
    /// 取胎位置
    /// </summary>
    public long StartLoc { get; set; }
    /// <summary>
    /// 胎胚条码
    /// </summary>
    public string ProductCode { get; set; }
}

public class TaskStatus
{
    public int StatusKey { get; set; }
    public string StatusDesc { get; set; }
}
public class ComboEquipBean
{
    /// <summary>
    /// 设备Id
    /// </summary>
    public long? Id { get; set; }
    /// <summary>
    /// 设备名称
    /// </summary>
    public string Name { get; set; }
}

public class TaskBean
{
    /// <summary>
    /// 任务号
    /// </summary>
    public int TaskNo { get; set; }
    /// <summary>
    /// 产品条码
    /// </summary>
    public string ProductCode { get; set; }
    /// <summary>
    /// 任务类型
    /// </summary>
    public int TaskType { get; set; }

    /// <summary>
    /// 组号
    /// </summary>
    public int? TaskGroup { get; set; }
    /// <summary>
    /// 任务类型描述
    /// </summary>
    public string TaskTypeDesc { get; set; }
    /// <summary>
    /// 开始货位
    /// </summary>
    public long StartLocId { get; set; }
    /// <summary>
    /// 开始货位
    /// </summary>
    public string StartLoc { get; set; }
    /// <summary>
    /// 开始设备
    /// </summary>
    public string StartEquip { get; set; }
    /// <summary>
    /// 当前货位
    /// </summary>
    public long CurrentLocId { get; set; }
    /// <summary>
    /// 当前货位
    /// </summary>
    public string CurrentLoc { get; set; }
    /// <summary>
    /// 当前设备Id
    /// </summary>
    public long CurrentEquipId { get; set; }
    /// <summary>
    /// 当前设备
    /// </summary>
    public string CurrentEquip { get; set; }
    /// <summary>
    /// 目标货位
    /// </summary>
    public long TargetLocId { get; set; }
    /// <summary>
    /// 目标货位
    /// </summary>
    public string TargetLoc { get; set; }
    /// <summary>
    /// 目标设备ID
    /// </summary>
    public long TargetEquipId { get; set; }
    /// <summary>
    /// 目标设备
    /// </summary>
    public string TargetEquip { get; set; }
    /// <summary>
    /// 任务状态
    /// </summary>
    public int TaskStatus { get; set; }
    /// <summary>
    /// 任务状态描述
    /// </summary>
    public string TaskStatusDesc { get; set; }
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime createTime { get; set; }
    /// <summary>
    /// 指令创建时间
    /// </summary>
    public DateTime cmdTime { get; set; }
    /// <summary>
    /// 指令执行时间
    /// </summary>
    public DateTime? cmdExcuteTime { get; set; }
    /// <summary>
    /// 指令列表
    /// </summary>
    public List<TaskCmdBean> TaskCmdList { get; set; }
    /// <summary>
    /// 任务状态
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 任务状态描述
    /// </summary>
    public decimal MaterialHeight { get; set; }
}
public class TaskOperParm
{
    /// <summary>
    /// 任务号
    /// </summary>
    public int TaskNo { get; set; }

    public int? IsDisable { get; set; }

}
public class TaskCmdOperParm
{

    /// <summary>
    /// 任务号
    /// </summary>
    public int TaskCmdId { get; set; }
}
public class TaskCmdBean
{
    /// <summary>
    /// ID
    /// </summary>
    public long TaskCmdId { get; set; }
    /// <summary>
    /// 任务号
    /// </summary>
    public int TaskNo { get; set; }
    /// <summary>
    /// 任务类型
    /// </summary>
    public int TaskType { get; set; }
    /// <summary>
    /// 任务类型描述
    /// </summary>
    public string TaskTypeDesc { get; set; }
    /// <summary>
    /// 设备
    /// </summary>
    public long EquipId { get; set; }
    /// <summary>
    /// 设备名称
    /// </summary>
    public string EquipName { get; set; }
    /// <summary>
    /// 起始库位
    /// </summary>
    public long StartLoc { get; set; }

    /// <summary>
    /// 当前货位
    /// </summary>
    public long CurrentLoc { get; set; }

    /// <summary>
    /// 目标货位
    /// </summary>
    public long TargetLoc { get; set; }
    /// <summary>
    /// 指令状态
    /// </summary>
    public int CmdStatus { get; set; }
    /// <summary>
    /// 指令状态描述
    /// </summary>
    public string CmdStatusDesc { get; set; }
    /// <summary>
    /// 旋转角度
    /// </summary>
    public decimal SpinAngle { get; set; }
    /// <summary>
    /// 是否喷涂
    /// </summary>
    public int Isspray { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }
}

public class AbnormalBean
{
    public string BarCode { get; set; }
    public DateTime? CreateTime { get; set; }
    public string AbnormalRemark { get; set; }
    public int TaskType { get; set; }
}
public class AbnormalParm
{
    /// <summary>
    /// 条码
    /// </summary>
    public string BarCode { get; set; }
}